<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title>沙立方</title>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="renderer" content="webkit">
	<!-- 设置缩放 -->
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />
	<!-- 可隐藏地址栏，仅针对IOS的Safari（注：IOS7.0版本以后，safari上已看不到效果） -->
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<!-- 仅针对IOS的Safari顶端状态条的样式（可选default/black/black-translucent ） -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<!-- IOS中禁用将数字识别为电话号码/忽略Android平台中对邮箱地址的识别 -->
	<meta name="format-detection" content="telephone=no, email=no" />
	<!-- 启用360浏览器的极速模式(webkit) -->
	<meta name="renderer" content="webkit">
	<!-- 避免IE使用兼容模式 -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
	<meta name="HandheldFriendly" content="true">
	<!-- 微软的老式浏览器 -->
	<meta name="MobileOptimized" content="320">
	<!-- uc强制竖屏 -->
	<meta name="screen-orientation" content="portrait">
	<!-- QQ强制竖屏 -->
	<meta name="x5-orientation" content="portrait">
	<!-- UC强制全屏 -->
	<meta name="full-screen" content="yes">
	<!-- QQ强制全屏 -->
	<meta name="x5-fullscreen" content="true">
	<!-- UC应用模式 -->
	<meta name="browsermode" content="application">
	<!-- QQ应用模式 -->
	<meta name="x5-page-mode" content="app">
	<!-- windows phone 点击无高光 -->
	<meta name="msapplication-tap-highlight" content="no">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="icon" type="image/png" href="../assets/i/favicon.png">
	<link rel="stylesheet" href="../assets/css/amazeui.css" />
	<link rel="stylesheet" href="../assets/css/app.css">
	<link rel="stylesheet" href="../assets/css/yttApp.css">
	<style>
	  .am-navbar .am-navbar-nav {padding-top:10px}
	</style>
</head>

<body class="shopPage bg-fff">
	<header data-am-widget="header" class="am-header bg-white am-header-fixed bg-085492" style="box-sizing: border-box;">
	    <div class="am-header-left am-header-nav hideDiv am-hide">
        <a href="#left-link" id="myLfb">
            <img src="../../img/lifangbi.png" style="height:20px">
            <span class="co-fff" id="moneyNow"></span>
        </a>
    </div>
		<h1 class="am-header-title teblack">
			<a href="#title-link" class="co-fff">商城</a>
		</h1>
		<div class="am-header-right am-header-nav text-black hideDiv am-hide" style="color:#F7B646;" id="vip">
           
        </div>
	</header>
  	
	<div class="am-container am-padding-0">
	    
		<div class="bg-fff am-margin-top-sm am-padding-sm zjyy_div borTop borBottom" onclick="goBuyCouse()">
			<div class="am-block over-hide">
				<span class="am-inline-block am-align-left am-margin-0 iconb">
					<img src="../img/courses.png" />
				</span>
				<b class="font14 am-inline-block am-align-left am-margin-0 am-padding-left-xs" style='padding-top:3px'>课程购买</b>
				<span class="am-inline-block font12 am-align-right am-margin-0 fontw600">
					<i class="am-icon-angle-right am-margin-left-xs am-icon-sm"></i></span>
			</div>
		</div>
		<div class="bg-fff vipDivs am-margin-top-sm am-padding-sm zjyy_div borTop borBottom">
			<div class="am-block over-hide">
				<span class="am-inline-block am-align-left am-margin-0 iconb">
					<img src="../img/courses.png" />
				</span>
				<b class="font14 am-inline-block am-align-left am-margin-0 am-padding-left-xs" style='padding-top:5px;color:#F7B646;'>尊享用户</b>
				<span class="am-inline-block am-align-right am-margin-0 fontw600">
				   <a class="padding05 radius4" onclick="recharge()">
					<button class="rechargeBtn" style="border-radius:12px;font-size:14px;padding:0.5rem 1rem">购买</button>
		           </a> 
				</span>
			</div>
		</div>
		<!-- <div class="vipDivs borT-EF am-hide" style="margin-top:10px;">
			 <div class="moneyDiv">
		         <a href="#left-link" class="font16">
		              <img src="../img/courses.png" style="height:24px"/>
		              <span style="color:#F7B646;font-size:1.4rem">尊享用户</span>
		          </a>
		       </div>
			 <div class="moneyDiv" style="text-align:center;">
		          <a href="#left-link">
					  <img src="../img/lifangbi.png" style="height:20px">
		              <span id="vipMoney"></span>
		          </a>
		      </div>
		      <div class="moneyDiv" style="text-align:right;float:right">
		          <a class="padding05 radius4" onclick="recharge()">
					<button class="rechargeBtn" style="border-radius:12px">购买</button>
		          </a>
		      </div>
		</div> -->
		<!-- 活动列表展示 -->
		<!-- <div class="bg-fff am-margin-top-sm am-padding-sm zjyy_div bottom-boshow3" onclick="">
			<div class="am-block over-hide">
				<div class="font14 am-inline-block am-align-left am-margin-0 am-padding-left-xs ycsn w85">
					庆祝环球中心店开业，充值满500送100
					<span>立即查看</span>
				</div>
				<span class="am-inline-block font12 am-align-right am-margin-0 fontw600">
					<i class="am-icon-angle-right am-margin-left-xs am-icon-sm"></i>
				</span>
			</div>
		</div>
		<div class="bg-fff am-margin-top-sm am-padding-sm zjyy_div bottom-boshow3" onclick="">
			<div class="am-block over-hide">
				<div class="font14 am-inline-block am-align-left am-margin-0 am-padding-left-xs ycsn w85">
					新用户首次购买任意课程包，可享受8折优惠
					<span>立即查看</span>
				</div>
				<span class="am-inline-block font12 am-align-right am-margin-0 fontw600">
					<i class="am-icon-angle-right am-margin-left-xs am-icon-sm"></i>
				</span>
			</div>
		</div>
		<div class="bg-fff am-margin-top-sm am-padding-sm zjyy_div bottom-boshow3" onclick="">
			<div class="am-block over-hide">
				<div class="font14 am-inline-block am-align-left am-margin-0 am-padding-left-xs ycsn w85">
					国画试听课（2017/02/01）立即查看
					<span>立即查看</span>
				</div>
				<span class="am-inline-block font12 am-align-right am-margin-0 fontw600">
					<i class="am-icon-angle-right am-margin-left-xs am-icon-sm"></i>
				</span>
			</div>
		</div> -->
	</div>
	
	<!--底部菜单-->
	<div data-am-widget="navbar" class="am-navbar am-cf bg-fff" id="mendb">
		<ul class="am-navbar-nav am-cf am-avg-sm-4" style="border-top:none;">
			<li>
				<a href="courseOrder.html">
					<img src="../img/yuyue2.png">
					<span class="am-navbar-label">预约</span>
				</a>
			</li>
			<li class="active">
				<a href="shopp.html">
					<img src="../img/shangcheng1.png">
					<span class="am-navbar-label">商城</span>
				</a>
			</li>
			<li>
				<a href="index.html">
					<img src="../img/zhuye2.png" style="height:35px;width:35px;margin-top:10px;">
				</a>
			</li>
			<li>
				<a href="find.html">
					<img src="../img/faxian2.png">
					<span class="am-navbar-label">发现</span>
				</a>
			</li>
			<li>
				<a onclick="checkPer()">
					<img src="../img/wode2.png">
					<span class="am-navbar-label">我的</span>
				</a>
			</li>
		</ul>
	</div>
	
	<div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading" data-am-modal="{closeViaDimmer: 0}">
		  <div class="am-modal-dialog" style="border-radius: 4px;">
		    	<div class="am-modal-hd">正在载入...</div>
			    <div class="am-modal-bd">
			      <span class="am-icon-spinner am-icon-spin"></span>
			    </div>
		  </div>
	</div>
	
       <div class="am-modal am-modal-alert" tabindex="-1" id="alert1" data-am-modal="{closeViaDimmer: 0}">
		  <div class="am-modal-dialog" style="border-radius: 4px;">
		    	<div class="am-modal-hd"></div>
			   	<div class="am-modal-bd alert1"></div>
		   		<div class="am-modal-footer">
		      		<span class="am-modal-btn">确定</span>
		    	</div>
	  		</div>
		</div>
		<!-- 充值 -->
		<div class="am-modal am-modal-alert" tabindex="-1" id="buyMoneyModal" data-am-modal="{closeViaDimmer: 0}">
		  <div class="am-modal-dialog" style="border-radius: 4px;">
		    	<div class="am-modal-hd"></div>
			   	<div class="am-modal-bd">余额不足，是否去充值？</div>
		   		<div class="am-modal-footer">
			      <span class="am-modal-btn" data-am-modal-confirm>去充值</span>
			      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
			    </div>
	  		</div>
		</div>
		<!--对应课程按钮操作-->
		<div class="am-modal am-modal-confirm " tabindex="-1" id="class_model" data-am-modal="{closeViaDimmer: 0}">
			<div class="am-modal-dialog radius10">
				<div class="am-modal-hd"></div>
				<div class="am-modal-bd"></div>
				<div class="am-modal-footer">
					<span class="am-modal-btn" data-am-modal-confirm>确定</span>
					<span class="am-modal-btn" data-am-modal-cancel>取消</span>
				</div>
			</div>
		</div>
	<!-- 登录弹窗 -->
		<div class="am-modal am-modal-alert" tabindex="-1" id="operationModal" data-am-modal="{closeViaDimmer: 0}">
		  <div class="am-modal-dialog" style="border-radius: 4px;">
		    	<div class="am-modal-hd"></div>
			   	<div class="am-modal-bd operationModalBody"></div>
		   		<div class="am-modal-footer">
		   		   <span class="am-modal-btn" data-am-modal-confirm>登录</span>
			      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
			    </div>
	  		</div>
		</div>
	<script src="../assets/js/jquery.min.js"></script>
	<script src="../assets/js/jquery.cookie.js"></script>
	<script src="../assets/js/amazeui.min.js"></script>
	<script src="../assets/js/fastclick.min.js"></script>
	<script src="../js/comm.js"></script>
	<script src="../js/slf.js"></script>
	<script>
	var money=0;
	$(function(){
		if(slf.checkSign()){
			//已登录
			console.log("已登录")
			$(".hideDiv").removeClass("am-hide")
			slf.ajax({
	            url: '/myCenter/getUserInfo',
	            success: function (data) {
	            	console.log(data)
	            	console.log("获取个人信息返回值")
	            	$("#moneyNow").html(data.obj.lfb);
	            	var childMess=slf.getSequenceChild();
	            	if(slf.schoolId=='a'||slf.schoolId==undefined||slf.schoolId==null){
	            		//无孩子
	            		$(".vipDivs").removeClass("am-hide");
	        			slf.ajax({
	           	            url: '/vipRelevant/getVipPrice',
	           	            success: function (data) {
	           	            	console.log("获取尊享用户")
	           	                var datas=eval('('+ data.obj+')')
	           	                money=datas.commodity_price;
	           	                $("#vipMoney").html(money)
	           	            }
	           	        });
	            	}else{
	            		if(childMess.vipLv==0){
		                	console.log("不是尊享")
		                	//不是尊享
		            	   $(".vipDivs").removeClass("am-hide")
		            	   slf.ajax({
			       	            url: '/vipRelevant/getVipPrice',
			       	            success: function (data) {
			       	                var datas=eval('('+ data.obj+')' )
			       	                console.log(datas);
			       	                money=datas.commodity_price;
			       	                $("#vipMoney").html(datas.commodity_price)
			       	            }
			       	        });
		               }else{
		            	   console.log("尊享")
		            	   $(".vipDivs").addClass("am-hide");
		            	   $("#vip").html("尊享用户");
		               }
	            	}
	                
	            }
	        });
		}else{
			//未登录
			console.log("未登录")
			$(".vipDivs").removeClass("am-hide");
			slf.ajax({
   	            url: '/vipRelevant/getVipPrice',
   	            success: function (data) {
   	            	console.log("获取尊享用户")
   	                var datas=eval('('+ data.obj+')')
   	                money=datas.commodity_price;
   	                $("#vipMoney").html(money)
   	            }
   	        });
			
			
		} 
	})
	function goBuyCouse(){
		window.location.href='course_pack.html'
	}
	function recharge(){
		if(slf.checkSign()){
			//已登录
			console.log("已登录")
			if(slf.schoolId=='a'||slf.schoolId==undefined||slf.schoolId==null){
				$("#class_model .am-modal-bd").html("请先完善孩子信息，是否现在去完善？")
				$("#class_model").modal({
					closeViaDimmer: false,
					onConfirm: function(options) {
						window.location.href = "personal/child_list.html"
			        },
				});
			}else{
				$("#class_model .am-modal-bd").html("您是否确认花费<span style='color:red'>"+money+"</span>立方币成为尊享用户？")
				$('#class_model').modal({
					relatedTarget: this,
					closeViaDimmer: false,
					onConfirm: function(options) {
						slf.ajax({
			   	            url: '/vipRelevant/insertVipSign',
			   	            success: function (data) {
			   	                console.log(data);
			   	                if(data.res==1){
			   	                	$(".alert1").html("购买成功")
			   	                	$("#alert1").modal();
			   	                	location.reload();
			   	                }else{
			   	                	if(data.resMsg=="余额不足。"){
			   	                		$("#buyMoneyModal").modal({
			   	                			closeViaDimmer: false,
			   	                			onConfirm: function() {
				   	             				window.location.href = "recharge.html"
				   	             	        },
			   	                		})
			   	                	}else{
			   	                		$(".alert1").html(data.resMsg)
				   	                	$("#alert1").modal();
			   	                	}
			   	                }
			   	            }
			   	        });
					}
				})
			}
		}else{
			//未登录
			var messPrompt="此功能仅对登录用户开放，是否需要登录？"
			$(".operationModalBody").html(messPrompt)
			$("#operationModal").modal({
				closeViaDimmer: false,
				onConfirm: function(options) {
					window.location.href = "login.html"
		        },
		        onCancel: function() {
		          
		        }
			})
		}
	}
	//个人中心
	function checkPer(){
		if(slf.checkSign()){
			//已登录
			window.location.href = "personal/index.html"
		}else{
			//未登录
			window.location.href = "personal/noLogin.html"
		}
	}
	</script>
</body>

</html>